<template>
<div>
	<home-header :city="city"></home-header>
	<home-swiper :list="swiperList"></home-swiper>
	<home-icons :icon="iconList"></home-icons>
	<home-recommend :recommend="recommendList"></home-recommend>
	<home-weekend :weekend="weekendList"></home-weekend>
</div>
  
</template>

<script>
	import homeHeader from './components/header'
	import homeSwiper from './components/swiper'
	import homeIcons from './components/icons'
	import homeRecommend from './components/recommend'
	import homeWeekend from './components/weekend'
	import axios from 'axios'
export default {
  name: 'home',
  components:{
	  homeHeader,
	  homeSwiper,
	  homeIcons,
	  homeRecommend,
	  homeWeekend
  },
	data (){
		return {
			city: '',
			swiperList: [],
			iconList: [],
			recommendList: [],
			weekendList: []
		}
	},
  methods: {
	  getHomeInfo () {
		  axios.get('/static/mock/index.json').then(this.getHomeInfoSucc)
	  },
	  getHomeInfoSucc (res){
			res = res.data;
			if(res.ret && res.data){
				this.city = res.city;
				this.swiperList = res.data.swiperList;
				this.iconList = res.data.iconList;
				this.recommendList = res.data.recommendList;
				this.weekendList = res.data.weekendList
			}
		  console.log(res)
			
	  }
  },
  mounted (){
	  this.getHomeInfo()
  }
}
</script>

<style>
	.home{
		font-size: 50px;
	}
</style>
